package AnaliseLexicaFinal.gui.Funcoes;

import java.io.*;

public class Arquivo {

	 public String LerArquivo(File arquivo){

		 StringBuffer bufferr = new StringBuffer();
		 try {
			 FileInputStream leitura = new FileInputStream(arquivo);
	         byte c;
	
	         do {
	             c = (byte)leitura.read();                    
	            	             
	             if (c!=-1) {
                     char a = (char) c;
                     if(a != '\r')
                         bufferr.append( (char)c );
		          }
	         } while (c != -1);
	
	      leitura.close();	      
	      String s = bufferr.toString();	
	      return(s);

		 } 
		  catch (IOException e) {
		      e.printStackTrace();
		  }
		  catch(NullPointerException nullPointerException){
		       System.out.println("erro");		
		}

  return null;
  }   
  
}
